﻿namespace Utility3D
{
    public struct Point3D
    {
        public Point3D(double x, double y, double z)
        {
            _x = x;
            _y = y;
            _z = z;
        }

        private readonly double _x;
        private readonly double _y;
        private readonly double _z;

        public double X { get { return _x; } }
        public double Y { get { return _y; } }
        public double Z { get { return _z; } }

        public static Vector3D operator -(Point3D start, Point3D end)
        {
            var start3D = new System.Windows.Media.Media3D.Point3D(start.X, start.Y, start.Z);
            var end3D = new System.Windows.Media.Media3D.Point3D(end.X, end.Y, end.Z);
            var result = start3D - end3D;
            return new Vector3D(result.X, result.Y, result.Z);
        }

        public override string ToString()
        {
            return string.Format("({0},{1},{2})", X, Y, Z);
        }
    }
}